/*
 * GenericCarTest.java
 *
 * This program demonstrates the tests the Generic class and accesses its
 * methods.
 *
 * Copyright � 2007 Aptech Software Limited. All rights reserved.
 */
package generic.demo;

import java.util.LinkedList;

/**
 * GenericCarTest is a class that will invoke the methods to add and display the
 * car details.
 *
 * @author vincent
 */
public class GenericCarTest {

    private static CarList<CarDetail> genericClass() {
        CarList<CarDetail> carList = new CarList<CarDetail>();
        carList.addCar("P001", new CarDetail("Qualis", "P001", "Luxury Car", "Toyota",
                new Double(15.95)));
        carList.addCar("P002", new CarDetail("Bentley", "P002", "Royal Car", "Mercedes Benz",
                new Double(25.25)));
        System.out.println(carList.getCar("P001").productName);
        System.out.println(carList.getCar("P002"));
        return carList;
    }

    /**
     * Creates a new instance of GenericCarTest
     */
    public GenericCarTest() {
    }

    /**
     *
     * This is the entry point of the Auborn & CorpCarDealer application.
     *
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        CarList<CarDetail> carList = genericClass();
        LinkedList<String> ll = new LinkedList<>();
        ll.add("1");
        carList.<String>display(ll);
        //    GenericCar<CarDetail> carDetailObj = new GenericCar<CarDetail>();
//    carDetailObj.add(new CarDetail("Qualis", "P001", "Luxury Car","Toyota",
//        new Double(15.95)));
//    carDetailObj.add(new CarDetail("Bentley", "P002", "Royal Car","Mercedes Benz",
//        new Double(25.25)));
//    carDetailObj.add(new CarDetail("Tucson", "P003", "SUV Car","Hyuandai",
//        new Double(20.00)));
//    System.out.println("Is the list empty? "+carDetailObj.checkEmpty());
//    System.out.println("Size of the list: "+carDetailObj.getSize());
//    System.out.println("Car Details:");
//    System.out.println("************");
//    carDetailObj.display();
//    System.out.println("\nFirst Record in the list: \n" + carDetailObj.grab());
    }
}
